package com.ineatconseil.yougo.beans;

import java.util.Date;

import org.apache.tapestry5.beaneditor.NonVisual;
import org.apache.tapestry5.beaneditor.Validate;

import com.ineatconseil.yougo.dto.RequestStatusDto;

/**
 * A vacation request.
 * 
 * @author johanblo
 * 
 */
public class Request {

	/**
	 * Unique identifier.
	 */
	@NonVisual
	private Long id;

	/**
	 * Begin date.
	 */
	@Validate("required")
	private Date from;

	/**
	 * End date.
	 */
	@Validate("required")
	private Date to;

	/**
	 * Ask comment.
	 */
	private String askComment;

	/**
	 * Answer comment.
	 */
	private String answerComment;

	/**
	 * The status of this request;
	 */
	@Validate("required")
	private RequestStatusDto status = RequestStatusDto.PENDING;

	/**
	 * Request type.
	 */
	@Validate("required")
	private Long typeId;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getFrom() {
		return from;
	}

	public void setFrom(Date from) {
		this.from = from;
	}

	public Date getTo() {
		return to;
	}

	public void setTo(Date to) {
		this.to = to;
	}

	public String getAskComment() {
		return askComment;
	}

	public void setAskComment(String askComment) {
		this.askComment = askComment;
	}

	public String getAnswerComment() {
		return answerComment;
	}

	public void setAnswerComment(String answerComment) {
		this.answerComment = answerComment;
	}

	public Long getTypeId() {
		return typeId;
	}

	public void setTypeId(Long typeId) {
		this.typeId = typeId;
	}

	public RequestStatusDto getStatus() {
		return status;
	}

	public void setStatus(RequestStatusDto status) {
		this.status = status;
	}

	public boolean isEmpty() {
		return this.from == null && this.to == null && this.id == null;
	}

}
